<{include file="db:`$mydirname`_header.html"}>

<{*  ---- If you use the XCAT's category, delete comment out. It is necessary to be installed XCAT. ----  *}>
<{if $cattree}>
<div id="category_tree">
<{* xcatsvc_tree2 tree=$cattree url="./index.php?cat_id=%d" count=$countByCat cols=3 next=5 *}>
<{* xcatsvc_roots tree=$cattree url="./index.php?cat_id=%d" count=$countByCat topCat=3 secCat=5 *}>
</div>
<{/if}>

<div style="margin:12px 0 16px 0; clear:both;"><{$lang_thereare}></div>


<{if $flatdata != ""}>


	<{if $navinfo && $nav}>
		<div>
			<div style="float:left;"><{$navinfo}></div>
			<div style="text-align:right;"><{$nav}></div>
		</div>
		<br style="clear:both;" />
	<{/if}>

	<!-- DATA -->
	<{if $ord}>
	<div style="text-align:right;">
		<img src="<{$myurl}>/images/asc.gif" title="<{$smarty.const._MD_FD_ORDER_ASC}>"> : <{$smarty.const._MD_FD_ORDER_ASC}> &nbsp; 
		<img src="<{$myurl}>/images/desc.gif" title="<{$smarty.const._MD_FD_ORDER_DESC}>"> : <{$smarty.const._MD_FD_ORDER_DESC}> 
	</div>
	<{/if}>

	<table id="fdtable">
	<tr>
	<th>NO</th>
	<{if $catTitleArr}>
		<th><{$smarty.const._MD_FD_CATEGORY}></th>
	<{/if}>
	<{foreach item=f from=$fields}>
		<{if $f.visible==1}>
			<th>
				<a href="<{$myurl}>/index.php?ord=<{if $ord|abs==$f.fid && $ord>0}>-<{/if}><{$f.fid}><{if $sq}>&amp;ao=<{$ao}>&amp;sf=<{$sf}>&amp;sq=<{$sq|rawurlencode}><{/if}><{if $category}>&amp;page=categ&amp;cat_id=<{$cat_id}><{/if}>"><{$f.fname}></a>
				<{if $ord|abs==$f.fid}>
					<img src="<{$myurl}>/images/<{if $ord>0}>asc<{else}>desc<{/if}>.gif" title="<{if $ord>0}><{$smarty.const._MD_FD_ORDER_ASC}><{else}><{$smarty.const._MD_FD_ORDER_DESC}><{/if}>">
				<{/if}>
			</th>
		<{/if}>
	<{/foreach}>
	<th>
		<a href="<{$myurl}>/index.php?ord=<{if $ord==A}>B<{else}>A<{/if}><{if $sq}>&amp;ao=<{$ao}>&amp;sf=<{$sf}>&amp;sq=<{$sq|rawurlencode}><{/if}><{if $category}>&amp;page=categ&amp;cat_id=<{$cat_id}><{/if}>"><{$smarty.const._MD_FD_DETAIL}></a>
		<{if $ord==A || $ord==B}>
			<img src="<{$myurl}>/images/<{if $ord==A}>asc<{elseif $ord==B}>desc<{/if}>.gif" title="<{if $ord==A}><{$smarty.const._MD_FD_ORDER_ASC}><{elseif $ord==B}><{$smarty.const._MD_FD_ORDER_DESC}><{/if}>">
		<{/if}>
	</th>
	<{if $isadmin}><th><{$smarty.const._EDIT}></th><{/if}>
	</tr>


	<{foreach item=fd from=$flatdata key=count name=i}>
		<tr class="<{cycle values='fdodd ,fdeven'}>">
		<td>
			<{if $fd.embed_url}><a href="<{$fd.embed_url}>" title="<{$smarty.const._MD_FD_EMBED_LOCATION}>"><{/if}>
				<{$p+$count+1}>
			<{if $fd.embed_url}></a><{/if}>
		</td>
		<{if $catTitleArr}>
			<td><a href="<{$myurl}>/index.php?page=categ&amp;cat_id=<{$fd.cat_id}>"><{if $fd.cat_id==0}><{$smarty.const._MD_FD_NONE}><{else}><{$catTitleArr[$fd.cat_id]}><{/if}></a></td>
		<{/if}>
		<{foreach item=ff from=$fields key=count_j name=j}>
			<{if $ff.visible==1}>
				<td><{$fd.data[$ff.fid]}></td>
			<{/if}>
		<{/foreach}>
		<td><a href="<{$myurl}>/index.php?did=<{$fd.did}>" title="DID:<{$fd.did}>"><{$smarty.const._MD_FD_DETAIL}></a></td>
		<{if $isadmin}><td><a href="<{$myurl}>/index.php?page=edit&amp;did=<{$fd.did}>"><{$smarty.const._EDIT}></a></td><{/if}>
		</tr>
	<{/foreach}>

	</table>
	<!-- DATA -->


	<{if $navinfo && $nav}>
		<div style="margin-top:16px;">
			<div style="float:left;"><{$navinfo}></div>
			<div style="text-align:right;"><{$nav}></div>
		</div>
		<br style="clear:both;" />
	<{/if}>

<{/if}>



<{include file="db:`$mydirname`_footer.html"}>
